package org.openstreetmap.travelingsalesman.actions;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.Action;

import org.openstreetmap.travelingsalesman.gui.MainFrame;
import org.openstreetmap.travelingsalesman.gui.NewProfileFrame;

public class NewProfile extends AbstractAction {

    /**
     * generated.
     */
    private static final long serialVersionUID = -8136640455463445179L;

    /**
     * Constructor for this action.
     */
    public NewProfile() {
        super(MainFrame.RESOURCE.getString("Actions.NewProfile.Label"));
        putValue(Action.SHORT_DESCRIPTION, MainFrame.RESOURCE.getString("Actions.NewProfile.Description"));
        /*
         * action.putValue(Action.SMALL_ICON, new ImageIcon(TaskPaneMain.class
         * .getResource(iconPath)));
         */
    }

    /**
     * ${@inheritDoc}.
     */
    @Override
    public void actionPerformed(final ActionEvent e) 
    {
        NewProfileFrame frame = new NewProfileFrame();
        frame.setDefaultCloseOperation(NewProfileFrame.DISPOSE_ON_CLOSE);
        frame.setTitle(MainFrame.RESOURCE.getString("NewProfile.Title"));
        frame.getContentPane().setPreferredSize(frame.getSize());
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }
}
